<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<css href="__PUBLIC__/Wife/css/admin.css"/>
<js href="__PUBLIC__/Wife/js/jquery-1.7.1.js"/>
<script>
$(function(){
$('span.add').click(function(){
	$('tr.last').after('<tr><td>&nbsp;</td>
      <td align="left"><input type="file" name="rypic[]" style="margin-left:40px;"/></td>
    </tr>');
})

$('span.del').click(function(){
	var id = $(this).attr('id');
	if (confirm('您确定要删除这张相片吗')){
		$.post('__URL__/delPic',{picname:id,ziduan:'honour'})
		$(this).parent().remove();
	}	
})

$('a.ad').click(function(){
	$(this).after('<input type="file" name="rypic[]" style="display:block"/>');
	$('input:submit').show();
})

})
</script>
<style type="text/css">
td ul li{margin-left:6px;}
td.tit input{display:block; background:#fff; border:0; border:1px solid #BBDDE5}
</style>
</head>
<body>
<div id="main">
	<div class="title">公司管理</div>
	<div class="content">
<if condition="($pics eq '')">
<form method="post" action="{:U('addPic')}" enctype="multipart/form-data">
  <table width="98%" border="0" cellpadding="0" cellspacing="0" class="mytab">
    <tr>
      <td colspan="2" class="tit">公司荣誉</td>
      </tr>
    <tr>
      <td><font style="color:blue; font-weight:900">上传相片:</font></td>
      <td align="left">相片一&nbsp;<input type="file" name="rypic[]" />
        <span class="add">&nbsp;&nbsp;<a href="javascript:void(0)">单击继续添加相片</a></span></td>
    </tr>
	 <tr>
      <td>&nbsp;</td>
      <td align="left">相片二&nbsp;<input type="file" name="rypic[]" /></td>
    </tr>
	    <tr class="last">
      <td>&nbsp;</td>
      <td align="left">相片三&nbsp;<input type="file" name="rypic[]" /></td>
    </tr>
  <tr>
      <td>&nbsp;</td>
      <td align="left"><input type="submit" name="aa" value="保存相册"/><input type="button" value="返回上一步" onClick="javscript:history.back()"/></td>
    </tr>
	</table>
	<input type="hidden" name="filename" value="rypic"/>
	<input type="hidden" name="field" value="honour"/>
</form>
<else/>
<form method="post" action="{:U('addPic')}" enctype="multipart/form-data" style="display:inline;">
<table width="98%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tit">公司荣誉<a href="javascript:void(0)" class="ad"><span class="tit" style="color:blue; margin-left:6px;">继续添加</span></a><input type="submit" value="添加" style="display:none"/></td></tr>
<tr><td>
<ul style="overflow:auto; width:100% ">

	<input type="hidden" name="filename" value="rypic"/>
	<input type="hidden" name="field" value="honour"/>
	
	<php>
	$pics = rtrim($pics,'-');
	$pics = explode('-',$pics);
	foreach($pics as $pic){
		echo '<li style="width:200px; height:240px; text-align:center; margin-top:10px; float:left"><img src="__PUBLIC__/Uploads/rypic/s_'.$pic.'" width="200" height="200"/><br><span id="'.$pic.'" class="del">删除</span></li>';
	}	
	</php>
</ul>
</if>
</td></tr>
</table>
</form>
</div>
</div>
</body>
</html>

